{% set pypi_name = 'oslotest' %}
{% set upstream_version = upstream_version('4.4.1') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        OpenStack test framework
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/oslotest
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('debtcollector') }}
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('python-subunit') }}
BuildRequires:  {{ py3('six') }}
BuildRequires:  {{ py3('stestr') }}
BuildRequires:  {{ py3('testtools') }}
BuildArch:      noarch

%description
The Oslo Test framework provides common fixtures, support for debugging, and
better support for mocking results.

%package -n {{ py2name(py_versions='py3') }}
Summary:        OpenStack test framework
Requires:       {{ py3('debtcollector') }}
Requires:       {{ py3('fixtures') }}
Requires:       {{ py3('mock') }}
# NOTE: python-os-client-config is only needed for functional testing
# Requires:       {{ py3('os-client-config') }}
Requires:       {{ py3('python-subunit') }}
Requires:       {{ py3('six') }}
Requires:       {{ py3('stestr') }}
Requires:       {{ py3('testtools') }}

%description -n {{ py2name(py_versions='py3') }}
The Oslo Test framework provides common fixtures, support for debugging, and
better support for mocking results.

This package contains the Python 3.x module.

%prep
%autosetup -p1 -n oslotest-%{version}
%py_req_cleanup

%build
%py3_build

%install
%py3_install

%check
python3 -m stestr.cli run

%files -n {{ py2name(py_versions='py3') }}
%license LICENSE
%doc ChangeLog README.rst
%{_bindir}/oslo_debug_helper
%{_bindir}/oslo_run_cross_tests
%{_bindir}/oslo_run_pre_release_tests
%{python3_sitelib}/oslotest
%{python3_sitelib}/oslotest*egg-info

%changelog
